
<div>
    <div class="panel panel-primary ">
        <div class="panel-heading p0 ">
            <ol class="breadcrumb m0 nav-style">
                <li><a href="#"><span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span> &nbsp;信息设置</a></li>
                <li class="active">添加类别</li>
            </ol>
        </div>
 
        <div class=" pannel-body">

            <ul id="myTab" class="nav nav-tabs">
                <li class="active">
                    <a href="/#port1" data-toggle="tab" ng-click="getSort()">
                        信息分类
                    </a>
                </li>
                <li><a href="/#port2" data-toggle="tab" ng-click="getClassifi()">信息分级</a></li>
                <li>
                    <a href="/#port3"
                       data-toggle="tab" id="getSource">来源渠道
                    </a>

                </li>
                <li><a href="/#port4" data-toggle="tab" id="getFenkou">信息分口</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="port1">

                    <div class=" panel-body">
                        <div class="form-group">
                            <table class="table table-bordered table-striped" >
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>分类名称</th>
                                    <th>分类备注</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="s in sort">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="s.name"></td>
                                    <td ng-bind="s.remark"></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-12">
                                <button class="btn btn-sm btn-primary col-xs-1 col-xs-offset-10" ng-click="addSort()">添加</button>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-pane fade" id="port2">
                    <div class=" panel-body">
                        <div class="form-group">
                            <table class="table table-bordered table-striped" >
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>分级名称</th>
                                    <th>分级备注</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="c in classifi">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="c.name"></td>
                                    <td ng-bind="c.level"></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-12">
                                <button class="btn btn-sm btn-primary col-xs-1 col-xs-offset-10" ng-click="addClassfi()">添加</button>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="tab-pane fade" id="port3">

                    <div class=" panel-body">
                        <div class="form-group" id="sourcetitle">
                             <table id="treeTable1" class="table table-striped table-bordered" >
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>来源渠道名称</th>
                                    <th>来源渠道备注</th>
                                </tr>
                                </thead>
                                <tbody>
                               
                                </tbody>
                            </table>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-12">
                                <button class="btn btn-sm btn-primary col-xs-1 col-xs-offset-10" ng-click="addSource()">添加</button>
                            </div>
                        </div>
                    </div>
                </div>
                 <div class="tab-pane fade" id="port4">
                    <div class=" panel-body">
                        <div class="form-group" id="porttitle">
                             <table class="table table-bordered table-striped" id="treeTable2" >
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>分口名称</th>
                                    <th>分口备注</th>
                                </tr>
                                </thead>
                                <tbody>
                                <!-- <tr ng-repeat="c in port">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="c.portName"></td>
                                    <td ng-bind="c.remark"></td>
                                </tr> -->
                                </tbody>
                            </table>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-12">
                                <button class="btn btn-sm btn-primary col-xs-1 col-xs-offset-10" ng-click="addClassport()">添加</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>


        </div>

    </div>


    <!-- 提交模态框 -->
    <div class="modal fade" id="addSort" >
        <div class="modal-dialog" style="width:40%; ">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加分类</h4>
                </div>
                <div class="modal-body col-xs-12">
                    <div class="form-group col-xs-12 ">
                        <label class="col-xs-2 control-label col-xs-offset-1">分类</label>
                        <div class="col-xs-5">
                            <input type="text" class="form-control col-xs-2"  placeholder="请输入分类名称"  id="sortName" >
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label col-xs-offset-1">备注</label>
                        <div class="col-xs-7">
                            <input type="text" class="form-control col-xs-3" placeholder="请输入备注" id="sortReMark" >
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="saveSort()">保存</button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="addClassfi" >
        <div class="modal-dialog" style="width:40%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加分级</h4>
                </div>
                <div class="modal-body col-xs-12">
                    <div class="form-group col-xs-12 ">
                        <label class="col-xs-2 control-label col-xs-offset-1">分级</label>
                        <div class="col-xs-5">
                            <input type="text" class="form-control col-xs-2" placeholder="请输入分级名称"  id="classfiName" >
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label col-xs-offset-1">备注</label>
                        <div class="col-xs-7">
                            <input type="text" class="form-control col-xs-3" placeholder="请输入备注" id="classfiLevel" >
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="saveClassfi()">保存</button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="addPort" >
        <div class="modal-dialog" style="width:40%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加分口</h4>
                </div>
                <div class="modal-body col-xs-12">
	                <div class="form-group col-xs-12 ">
	                        <label class="col-xs-2 control-label col-xs-offset-1 ">父级分口</label>
	                        <div class="col-xs-5">
	                        	<select id="port-select"  class="form-control" >
	                        		<option value="0">一级分口</option>
	                        		<option ng-repeat="s in port"  value="{{s.id}}">{{s.portName}}</option>
					      		</select>
	                        </div>
	                </div>
                    <div class="form-group col-xs-12 ">
                        <label class="col-xs-2 control-label col-xs-offset-1">分口</label>
                        <div class="col-xs-5">
                            <input type="text" class="form-control col-xs-2" placeholder="请输入分口名称"  id="classport" >
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-2 control-label col-xs-offset-1">备注</label>
                        <div class="col-xs-7">
                            <input type="text" class="form-control col-xs-3" placeholder="请输入备注" id="classpo" >
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="savePort()">保存</button>
                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="addSource" >
        <div class="modal-dialog" style="width:40%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加来源渠道</h4>
                </div>
                <div class="modal-body col-xs-12">
                 	<div class="form-group col-xs-12 ">
                        <label class="col-xs-3 control-label ">父级渠道</label>
                        <div class="col-xs-5">
                        	<select id="source-select"  class="form-control" >
                        		<option value="0">一级渠道</option>
                        		<option ng-repeat="s in source"  value="{{s.id}}">{{s.name}}</option>
				      		</select>
                        </div>
                    </div>
                    <div class="form-group col-xs-12 ">
                        <label class="col-xs-3 control-label ">来源渠道</label>
                        <div class="col-xs-5">
                            <input type="text" class="form-control data-source col-xs-3" placeholder="请输入来源渠道名称"  id="sourceName" >
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label class="col-xs-3 control-label ">渠道备注</label>
                        <div class="col-xs-5">
                            <input type="text" class="form-control col-xs-3" placeholder="请输入备注" id="sourceMark" >
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="saveSource()">保存</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 失败模态框 -->
    <div class="modal fade " id="badmodal">
        <div class="modal-dialog" style="width: 300px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">失败</h4>
                </div>
                <div class="modal-body">
                    <span id="idNumber" ></span>
                    <p>操作失败</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">确认</button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal-->
</div>